<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加站点</title>
</head>
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
<body>
<form id="myForm" method="post" action="/back/host/editHost">
    returnUrl：<input id="returnUrl" name="returnUrl" th:value="${host.returnUrl}" type="text" style="width: 320px">
    email：<input id="email" name="email" type="text" th:value="${host.email}" style="width: 320px">
    <input type="button" value="保存" onclick="save()">
    <input type="hidden" id="hostId" th:value="${host.hostId}">
</form>
</body>
<script>

    function save() {
        $.ajax({
            url : '/back/host/updateHost',
            type : 'POST',
            dataType : 'JSON',
            data : {
                hostId : $("#hostId").val() ,
                returnUrl : $("#returnUrl").val() ,
                email : $("#email").val()
            },
            success : function(result) {
                window.location.href = "/back/host/hosts";
            }
        });
    }
</script>
</html>